var express = require('express');
var router = express.Router();

var data = [{
    adName: 'B计划',
    custName: '张张张',
    time: '2018-07-07',
    exposure_num: '13313',
    click_num: '31351',
    click_percent: '1.4%',
    click_price: '0.5',
    consume: '100'
  },
  {
    adName: '计划1',
    custName: '成龙',
    time: '2018-09-01',
    exposure_num: '12300',
    click_num: '4564',
    click_percent: '100%',
    click_price: '0.5',
    consume: '100'
  },
  {
    adName: '飞鹰计划',
    custName: '陈港生',
    time: '2018-10-10',
    exposure_num: '1545440',
    click_num: '451451456',
    click_percent: '12%',
    click_price: '0.5',
    consume: '100'
  },
  {
    adName: '夺宝奇兵',
    custName: '嘿嘿嘿',
    time: '2018-11-12',
    exposure_num: '45354',
    click_num: '1212313',
    click_percent: '3%',
    click_price: '0.5',
    consume: '100'
  },
  {
    adName: '盗墓笔记',
    custName: '小哥',
    time: '2018-11-13',
    exposure_num: '453321321',
    click_num: '554656',
    click_percent: '20%',
    click_price: '0.5',
    consume: '100'
  }
];
// http://localhost:3000/api/ad?
// page=1&size=50&name=&status=0&time=2017-12-29+-+2017-12-29
router.get('/', function (req, res, next) {
  var rst = {
    code: 10004,
    msg: 'success',
    data: {
      current_page: 1,
      total: 5,
      per_page: 10,
      data: data
    }
  };
  res.json(rst);
});

module.exports = router;
